https://glot.io/snippets/gi68zzsyvg/raw/main.lua